module.exports = (sequelize, DataTypes) => {
  const shop = sequelize.define('shop', {
    id: {
      type: DataTypes.INTEGER,
      allowNull: false,
      primaryKey: true,
      autoIncrement: true
    },
    code: {
      type: DataTypes.STRING(128),
      allowNull: false
    },
    name: {
      type: DataTypes.STRING(128),
      allowNull: false
    },
    creator: {
      type: DataTypes.STRING(128),
      allowNull: false
    },
    brand: {
      type: DataTypes.STRING(128),
      allowNull: false
    },
    url: {
      type: DataTypes.STRING(128),
      allowNull: false
    },
    imgUrl: {
      type: DataTypes.STRING(128),
      allowNull: false
    },
    detail: {
      type: DataTypes.STRING(256),
      allowNull: false
    }
  },
  {
    freezeTableName: true,
    timestamps: false
  })
  //   log.associate = models => {
  //     log.belongsTo(models.application, { foreignKey: 'application_id' })//多对一
  //     log.hasMany(models.components, { foreignKey: 'page_id' })
  //   }
  return shop
}
